﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBEngine.Elements;
using DBEngine.Tables;
namespace DBEngine
{
    public class DatabaseManager
    {

        private static Table CLIENTS_INFO_TABLE;
        private static Table GLASSES_EXAMINATION_TABLE;
        private static Table LENSES_EXAMINATION_TABLE;
        private static Table GLASSES_ORDER_TABLE;
        private static Table LENSES_ORDER_TABLE;

        static DatabaseManager()
        {
            CLIENTS_INFO_TABLE = new ClientInfoTable();
            GLASSES_EXAMINATION_TABLE = new GlassesExaminationTable();
            GLASSES_ORDER_TABLE = new GlassesOrderTable();
            LENSES_EXAMINATION_TABLE = new LensesExaminationTable();
            LENSES_ORDER_TABLE = new LensesOrderTable();
        }

        public Boolean Update(ClientInfo clientInfo)
        {
            return CLIENTS_INFO_TABLE.Update(clientInfo);
        }
        public Boolean Insert(ClientInfo clientInfo)
        {
            return CLIENTS_INFO_TABLE.Insert(clientInfo);
        }

        public Boolean Update(GlasesExamination glasesExamination)
        {
            return GLASSES_EXAMINATION_TABLE.Update(glasesExamination);
        }
        public Boolean Insert(GlasesExamination glasesExamination)
        {
            return GLASSES_EXAMINATION_TABLE.Insert(glasesExamination);
        }

        public Boolean UpdateGlassOrder(Order glasesOrder)
        {
            return GLASSES_ORDER_TABLE.Update(glasesOrder);
        }


        public Boolean InsertGlassOrder(Order glasesOrder)
        {
            return GLASSES_ORDER_TABLE.Insert(glasesOrder);
        }


        public Boolean Update(LensesExamination lensesExamination)
        {
            return LENSES_EXAMINATION_TABLE.Update(lensesExamination);
        }
        public Boolean Insert(LensesExamination lensesExamination)
        {
            return LENSES_EXAMINATION_TABLE.Insert(lensesExamination);
        }

        public Boolean UpdateLensesOrder(Order lensesOrder)
        {
            return LENSES_ORDER_TABLE.Update(lensesOrder);
        }


        public Boolean InsertLensesOrder(Order lensesOrder)
        {
            return LENSES_ORDER_TABLE.Insert(lensesOrder);
        }
    }
}
